package com.lechuang.member.manager.Impl;

import com.lechuang.member.entity.MemberStarLevel;
import com.lechuang.member.manager.MemberStarLevelManager;
import com.lechuang.member.service.MemberStarLevelService;
import com.lechuang.member.vo.MemberStarLevelVo;
import jakarta.annotation.Resource;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author apple
 * @version 1.0
 * @date 2024/6/22
 */
@Service
@Log4j2
public class MemberStarLevelManagerImpl implements MemberStarLevelManager {

    @Resource
    private MemberStarLevelService memberStartLevelService;

    @Override
    public List<MemberStarLevelVo> list() {
        List<MemberStarLevelVo> memberStartLevelVoList =new ArrayList<MemberStarLevelVo>();
        List<MemberStarLevel> memberLevelVoList = memberStartLevelService.list();
        memberLevelVoList.forEach(bean->{
            MemberStarLevelVo memberStartLevelVo = new MemberStarLevelVo();
            memberStartLevelVo.setId(bean.getId());
            memberStartLevelVo.setName(bean.getName());
            memberStartLevelVoList.add(memberStartLevelVo);
        });
        return memberStartLevelVoList;
    }
}
